gtkpopover: Re-present surface if position/pointing-to change while visible
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 27 Feb 2020 17:08:46 +0000 (18:08 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 20 Mar 2020 14:52:19 +0000 (15:52 +0100)
This ensures the popover will follow the new position parameters. This is
necessary for popovers like the text magnifier that can be repositioned
while visible.

gtk/gtkpopover.c

index c6e2d70e0d9f15625eb5d2d2fc904c00c34358b2..088759f45c230d612b1ab13bd35df0a81010e5ae 100644 (file)
@@ -1657,6 +1657,9 @@ gtk_popover_set_pointing_to (GtkPopover         *popover,
     priv->has_pointing_to = FALSE;
 
   g_object_notify_by_pspec (G_OBJECT (popover), properties[PROP_POINTING_TO]);
+
+  if (gtk_widget_is_visible (GTK_WIDGET (popover)))
+    present_popup (popover);
 }
 
 /**
@@ -1726,6 +1729,9 @@ gtk_popover_set_position (GtkPopover      *popover,
   priv->final_position = position;
 
   g_object_notify_by_pspec (G_OBJECT (popover), properties[PROP_POSITION]);
+
+  if (gtk_widget_is_visible (GTK_WIDGET (popover)))
+    present_popup (popover);
 }
 
 /**